package jcommon.chap2_string;

import org.apache.commons.lang.StringUtils;

public class Chomping {

	public static void main(String[] args) {
		System.out.println("-------- Remove the last line termination sequence from a string --------");
		String input = "Hello\n";
		String chomped = StringUtils.chomp( input );
		System.out.println(chomped);
		// chomped equals "Hello"

		String input2 = "Another test\r\n";
		String chomped2 = StringUtils.chomp( input2 );
		System.out.println(chomped2);
		// chomped2 equals "Another test";

	}
}
